package com.pmcc.cj.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.pmcc.core.entity.UUIDEntity;
import com.pmcc.utils.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 购物车
 * Created by tomas on 2020/9/5.
 */
@Entity
@Table(name = "cj_shopping_cart")
public class CjShoppingCart extends UUIDEntity {
    @Column(name = "commodity_id")
    private String commodityId;//商品id
    @Column(name = "employee_id")
    private String employeeId;//购物人员id
    @Column(name = "money")
    private BigDecimal money;//商品单价
    @Column(name = "total_money")
    private BigDecimal totalMoney;//商品总价
    //商品类型  0：云商城    1：云飞防
    @Column(name = "fettle")
    private Integer fettle;
    @Column(name = "commodity_count")
    private Integer commodityCount;//商品亩数
    @Column(name = "combination")
    private Boolean combination=false;//是否是组合商品
    @Column(name = "rule_id")
    private String ruleId;//满减规则id
    @Column(name = "create_time")
    private Date createTime;//创建时间或者修改时间

    //    @Column(name = "number_car")
//    private Double numberCar;//商品个数
    //    @Column(name = "commodity_type")
//    private String commodityType;//商品规格

    @Transient
    private String jsonData;
    @Transient
    private String name; //分类名称
    @Transient
    private String commodityYunImage;//云飞防商品图片

    @Transient
    private List<CjShoppingCartDetail> detailList;

    public String getCommodityYunImage() {
        return commodityYunImage;
    }

    public void setCommodityYunImage(String commodityYunImage) {
        this.commodityYunImage = commodityYunImage;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<CjShoppingCartDetail> getDetailList() {
        return detailList;
    }

    public void setDetailList(List<CjShoppingCartDetail> detailList) {
        this.detailList = detailList;
    }

    public String getJsonData() {
        return jsonData;
    }

    public void setJsonData(String jsonData) {
        this.jsonData = jsonData;
    }

    public String getRuleId() {
        return ruleId;
    }

    public void setRuleId(String ruleId) {
        this.ruleId = ruleId;
    }

    public Integer getCommodityCount() {
        return commodityCount;
    }

    public void setCommodityCount(Integer commodityCount) {
        this.commodityCount = commodityCount;
    }

    public Boolean getCombination() {
        return combination;
    }

    public void setCombination(Boolean combination) {
        this.combination = combination;
    }

    public Integer getFettle() {
        return fettle;
    }

    public void setFettle(Integer fettle) {
        this.fettle = fettle;
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    public String getCommodityId() {
        return commodityId;
    }

    public void setCommodityId(String commodityId) {
        this.commodityId = commodityId;
    }

    public String getEmployeeId() {
        return employeeId;
    }

    public void setEmployeeId(String employeeId) {
        this.employeeId = employeeId;
    }
    @JsonSerialize(using = DateTimeFormat.class)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public BigDecimal getTotalMoney() {
        return totalMoney;
    }

    public void setTotalMoney(BigDecimal totalMoney) {
        this.totalMoney = totalMoney;
    }
}
